#!/bin/sh

rm -rf ./tmp
mkdir ./tmp

find src -name \*.java >./tmp/javaFiles.list
javac -encoding gbk -d ./tmp -cp ./src/core/marsiot-pi-core.jar  @./tmp/javaFiles.list
if [ $? -ne 0 ]; then
    exit 1;
fi

jar -cvf ./tmp/marsiot-pi-sdk-small.jar ./tmp/com
cd ./tmp
rm ./marsiot-pi-sdk-small.jar ./javaFiles.list
jar -xf ../src/core/marsiot-pi-core.jar
cd ..
jar -cf marsiot-pi-sdk.jar -C ./tmp .

rm -rf ./tmp 

